#include <cstdio>

const int N = 1000, inf = 0x3fffffff;
int n, m, q, map[5][N];

struct Node {
  int d[5][5];
} tr[N << 2];

void build(int x, int l, int r) {
  if (l == r) {
    for (int i = 0; i < n; ++i) {
    }
  }
}
int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("testdata.in", "r", stdin);
  freopen("testdata.out", "w", stdout);
#endif
#ifndef LOCAL
  freopen("maze.in", "r", stdin);
  freopen("maze.out", "w", stdout);
#endif
#endif

  scanf("%d%d%d", &n, &m, &q);
  for (int i = 0; i < n; ++i)
    for (int j = 1; j <= m; ++j) scanf("%d", &map[i][j]);
  build(1, 1, m);
  return 0;
}